﻿var CryptoJS = require('crypto-js');

function hash(type, value) {
    if (type == 'md5') {
        return CryptoJS.MD5(value).toString();
    } else if (type == 'sha1') {
        return CryptoJS.SHA1(value).toString();
    }
    if (type == 'sha256') {
        return CryptoJS.SHA256(value).toString();
    }
}

var _0x3844b6 = {
    'WQqlG': function (_0x43c295, _0x4bea84) {
        return _0x43c295 < _0x4bea84;
    },
    'meLmM': function (_0x130eba, _0x3899d5) {
        return _0x130eba + _0x3899d5;
    },
    'twPbf': function (_0x3d7ff9, _0x4e7446) {
        return _0x3d7ff9 == _0x4e7446;
    }
}


function _0x190c36(_0x238288, _0x341134, _0x34eb9c) {
    var _0xa1be12 = new Date();
    var _0x78f52e = _0x238288['chars']['length'];
    for (var _0x96ad7c = 0x0; _0x96ad7c < _0x78f52e; _0x96ad7c++) {
        for (var _0x39b768 = 0x0; _0x3844b6['WQqlG'](_0x39b768, _0x78f52e); _0x39b768++) {
            var _0x15c4ad = _0x3844b6['meLmM'](_0x34eb9c[0x0] + _0x238288['chars']['substr'](_0x96ad7c, 0x1), _0x238288['chars']['substr'](_0x39b768, 0x1)) + _0x34eb9c[0x1];
            if (_0x3844b6['twPbf'](hash(_0x238288['ha'], _0x15c4ad), _0x341134)) {
                return [_0x15c4ad, new Date() - _0xa1be12];
            }
        }
    }
};

function getCookies(_0x238288) {
    var _0x732635 = _0x190c36(_0x238288, _0x238288['ct'], _0x238288['bts'])
    return {'__jsl_clearance_s': _0x732635 [0]};
};



